/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.guet.careapp.pojo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author LXM
 */
@Entity
@Table(name = "t_user_homeserve_people_info")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TUserHomeservePeopleInfo.findAll", query = "SELECT t FROM TUserHomeservePeopleInfo t"),
    @NamedQuery(name = "TUserHomeservePeopleInfo.findByHId", query = "SELECT t FROM TUserHomeservePeopleInfo t WHERE t.hId = :hId"),
    @NamedQuery(name = "TUserHomeservePeopleInfo.findByName", query = "SELECT t FROM TUserHomeservePeopleInfo t WHERE t.name = :name"),
    @NamedQuery(name = "TUserHomeservePeopleInfo.findByIdetifyNum", query = "SELECT t FROM TUserHomeservePeopleInfo t WHERE t.idetifyNum = :idetifyNum"),
    @NamedQuery(name = "TUserHomeservePeopleInfo.findByPhone", query = "SELECT t FROM TUserHomeservePeopleInfo t WHERE t.phone = :phone")})
public class TUserHomeservePeopleInfo implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "h_id")
    private Integer hId;
    @Size(max = 30)
    @Column(name = "name")
    private String name;
    @Size(max = 60)
    @Column(name = "idetify_num")
    private String idetifyNum;
    // @Pattern(regexp="^\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})$", message="电话/传真格式无效, 应为 xxx-xxx-xxxx")//if the field contains phone or fax number consider using this annotation to enforce field validation
    @Size(max = 20)
    @Column(name = "phone")
    private String phone;
    @JoinColumn(name = "c_info_id", referencedColumnName = "c_id")
    @ManyToOne(optional = false)
    private TCompanyInfo cInfoId;

    public TUserHomeservePeopleInfo() {
    }

    public TUserHomeservePeopleInfo(Integer hId) {
        this.hId = hId;
    }

    public Integer getHId() {
        return hId;
    }

    public void setHId(Integer hId) {
        this.hId = hId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIdetifyNum() {
        return idetifyNum;
    }

    public void setIdetifyNum(String idetifyNum) {
        this.idetifyNum = idetifyNum;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public TCompanyInfo getCInfoId() {
        return cInfoId;
    }

    public void setCInfoId(TCompanyInfo cInfoId) {
        this.cInfoId = cInfoId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (hId != null ? hId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TUserHomeservePeopleInfo)) {
            return false;
        }
        TUserHomeservePeopleInfo other = (TUserHomeservePeopleInfo) object;
        if ((this.hId == null && other.hId != null) || (this.hId != null && !this.hId.equals(other.hId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pojo.TUserHomeservePeopleInfo[ hId=" + hId + " ]";
    }
    
}
